using System;
using System.Collections.Generic;
using System.Text;

namespace LogAnalyzerIIS.Objects
{
	/// <summary>
	/// Structure for storing column information from database
	/// </summary>
	public struct DBColumn
	{
		private string columnName;
		private string columnType;
		private int maxLength;			// Max length for string column
		private string title;

		/// <summary>
		/// Constructor for DBColumn
		/// </summary>
		/// <param name="name">Column name</param>
		/// <param name="type">Column type</param>
		/// <param name="maxlength">Max length for strings</param>
		public DBColumn(string name, string type, int maxlength)
		{
			columnName = name;
			columnType = type;
			maxLength = maxlength;
			title = name;
		}

		/// <summary>
		/// Constructor for DBColumn
		/// </summary>
		/// <param name="name">Column name</param>
		/// <param name="type">Column type</param>
		/// <param name="maxlength">Max length for strings</param>
		public DBColumn(string name, string type, int maxlength, string _title)
		{
			columnName = name;
			columnType = type;
			maxLength = maxlength;
			title = _title;
		}

		/// <summary>
		/// Column name
		/// </summary>
		public string ColumnName
		{
			get { return columnName; }
			set { columnName = value; }
		}

		/// <summary>
		/// Column type
		/// </summary>
		public string CellType
		{
			get { return columnType; }
			set { columnType = value; }
		}

		/// <summary>
		///  Max length
		/// </summary>
		public int MaxLength
		{
			get { return maxLength; }
		}

		/// <summary>
		/// Overridden version of Object.ToString()
		/// </summary>
		/// <returns></returns>
		public override string ToString()
		{
			return title;
		}
	}
}
